package kr.saeildamil.androidstudty.ch13;

import kr.saeildamil.androidstudty.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.TextView;

public class RatingBarTest extends Activity {
	RatingBar rb;
	TextView tv;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_ratingbar);
		
		rb = (RatingBar) findViewById(R.id.ch13_ratingbar_rb);
		tv = (TextView) findViewById(R.id.ch13_ratingbar_tv);
		
		rb.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
			
			@Override
			public void onRatingChanged(RatingBar ratingBar, float rating,
					boolean fromUser) {
			tv.setText("Now rate : " + rating);	
			}
		});
		
		
	}

}
